//
//  CheckNetConnect.m
//  XMLY
//
//  Created by lanou on 15/11/7.
//  Copyright © 2015年 曾杰. All rights reserved.
//

#import "CheckNetConnect.h"
#import "Reachability.h"
@implementation CheckNetConnect
+ (instancetype)shareConnect{
    static CheckNetConnect *netConnect = nil;
    static dispatch_once_t onceToken;
    dispatch_once(&onceToken, ^{
        netConnect = [[CheckNetConnect alloc] init];
    });
    return netConnect;
}
- (BOOL)netConnectState{
    Reachability *reach = [Reachability reachabilityWithHostName:@"www.apple.com"];
    switch ([reach currentReachabilityStatus]) {
        case NotReachable:
            return NO;
            break;
            
        default:
            break;
    }
    return YES;
}
@end
